package com.chapter1;

/**
 * @Classname Immutable
 * @Description String对象是不可改变的，String类是final关键字修饰的。
 * @Date 2019/5/4 23:07
 * @Created by xiangty
 */
public class Immutable {

	public static void main(String[] args) {
		String str1 = "hello";
		System.out.println(str1);

		String str2 = upcase(str1);
		System.out.println(str2);
		System.out.println(str1);
	}

	/**
	 * 将字符转换为大写
	 * 
	 * @return
	 */
	public static String upcase(String s) {
		return s.toUpperCase();
	}

}
